
#include <p18cxxx.h>
#include "typedefs.h"  
#include "EEpromInt.h"
/*
void EEWrite(UINT_8 ad,UINT_8 val)
{
//	static unsigned char GIE_Status;
	EEADR = ad;  //EEPROM memory location
	EEDATA = val;     //Data to be writen 
	EECON1bits.EEPGD=0;    //Enable EEPROM write
	EECON1bits.CFGS=0;    //Enable EEPROM write
	EECON1bits.WREN = 1;   //Enable EEPROM write
	EECON2 = 0x55;     //Required sequence to start write cycle
	EECON2 = 0xAA;     //Required sequence to start write cycle
	EECON1bits.WR = 1;    //Required sequence to start write cycle
	while(EECON1bits.WR);   //Wait for completion of write sequence
	PIR2bits.EEIF = 0;    //Disable EEPROM write
	EECON1bits.WREN = 0;   //Disable EEPROM write

} 
*/
UINT_8 EERead(UINT_8 ad)
{
	EEADR = ad;  //EEPROM memory location
	EECON1bits.EEPGD = 0;   //Enable read sequence
	EECON1bits.CFGS = 0;   //Enable read sequence
	EECON1bits.RD = 1;    //Enable read sequence
	return EEDATA;
}
